#ifndef RGUI_RENDER_OBJECT_HPP
#define RGUI_RENDER_OBJECT_HPP

#include "RenderEffect.hpp"
#include "vec2.hpp"

namespace rgui
{

// Pure virtual (abstract) class for objects that are renderable (button, window, etc)
class RenderObject
{
public:
							RenderObject();

	bool					isVisible();

	// This function should be overriden when using static GUI system, like windows own GUI system for example.
	// And this virtual function should be called inside the virtual overrider function.
	virtual void			setVisible(bool visible);

	virtual void			onMousePressed(const rgui::vec2i &cursorPosition) = 0;
	virtual void			onMouseReleased(const rgui::vec2i &cursorPosition) = 0;
	virtual void			onClick(const rgui::vec2i &cursorPosition) = 0;
	virtual void			update(const rgui::vec2i &cursorPosition) = 0;
	virtual void			render(const rgui::RenderEffect &renderEffect = rgui::RenderEffect()) = 0;

	static RenderObject*	getLastSelected();
	static void				setLastSelected(RenderObject *renderObject);
private:
	bool mVisible;
	static RenderObject *lastSelectedObject;
};

}

#endif